package com.fzhucc.modules.subject.repository;

import com.fzhucc.modules.subject.domain.entity.SubjectHighfieldsType2;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import javax.annotation.Nullable;
import java.util.List;

/**
* @website https://fzhucc.com
* @author yyg
* @since 2022-09-26 00:00:00
**/
public interface SubjectHighfieldsType2Repository extends JpaRepository<SubjectHighfieldsType2, Integer>, JpaSpecificationExecutor<SubjectHighfieldsType2> {

    @Nullable
    @Query("SELECT o from SubjectHighfieldsType2 as o where o.highfields1=:highfields1 and o.type=:type order by o.sort")
    List<SubjectHighfieldsType2> findByHighfields1(String highfields1,String type);



    @Nullable
    @Query("SELECT o from SubjectHighfieldsType2 as o where o.highfields1=:highfields1 and o.highfields2=:highfields2 and o.type=:type order by o.sort")
    List<SubjectHighfieldsType2> findByHighfields1With2(String highfields1,String type,String highfields2);
}